package com.ex.controller;

import com.ex.dto.GoodsDto;
import com.ex.pojo.Goods;
import com.ex.pojo.Result;
import com.ex.service.GoodsService;
import com.ex.vo.GoodsVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * TODO
 * discrb:
 *
 * @Author CD
 * @Date2025/6/6 21:28
 */
@RestController
@Slf4j
@RequestMapping("/goods")
public class GoodsController {
    @Autowired
    private GoodsService goodsService;

    /**
     * 条件查询商品
     * @param dto
     * @return
     */
    @GetMapping("/list")
    public Result findGoodsList(GoodsDto dto){
        log.info("条件查询商品{}",dto);
        List<GoodsVo> goodsList= goodsService.findGoodsList(dto);
        return Result.sucess(goodsList);
    }


}
